#!/bin/sh

#项目地址
projectPath="/Users/wt/Desktop/zt_driver"
#andiroid 打包后的路径
buildpath="$projectPath/build/app/outputs/apk/release"
#用来共享的目录(带文件名可直接修改名字)
sharepath="/Users/wt/Documents/file/zt_driver.apk"
echo "开始打包"
cd $projectPath
pwd
flutter clean
flutter build apk --target-platform android-arm64
echo "+==================================++++++++++"
echo "+==================================++++++++++"
echo "+==================================++++++++++"
echo "+==================================++++++++++"
echo "打包结束"

#rootPath="/Users/wt/Documents/images"
for file in $(ls $buildpath)
do
      if test -d $file
      then
        echo "目录"
        echo $file
      else
      
        echo "找到文件"
        echo $file
        if [ "${file##*.}"x = "apk"x ];then
          filepath="$buildpath/$file"
          mv $filepath  $sharepath

        fi
      fi
done
